<?php
namespace Home\Controller;
use Think\Controller;
class CompanyFrameworkController extends CommonController{
	function index(){
		$model = M("company_framewor");
		$content = $model->where('id=1')->getField("content");
		$this->assign("content", $content);
		$this->display();
	}
	
	function edit(){
		$model = M("company_framewor");
		$content = $model->where('id=1')->getField("content");
		$this->assign("content", $content);
		$this->display();
	}
	
	function save(){
		$model = M("company_framewor");
		$data['content'] = $_POST['content'];
		$count = $model->where('id=1')->count();
		if($count == 0){
			$data['id'] = 1;
			$success = $model->add($data);
		}else{
			$success = $model->where('id=1')->save($data);
		}
		if($success){
			$this->success("公司组织架构图保存成功！", "edit");
		}else{
			$this->error("公司组织架构图保存失败！");
		}
	}
    
    public function _empty($name){
    	$this->emptyaction($name);
    }
}
?>